<template>
  <!-- 表单字段项配置 -->
  <EditFieldConfig
    ref="el"
    :func-bean="funcBean"
    :record-data="bean"
    :drawer="drawer"
    :form-design="formDesign"
  />
</template>
<script>
  import { defineComponent, ref } from 'vue';
  import EditFieldConfig from '@/components/form-field-config/components/edit-field-config.vue';
  export default defineComponent({
    name: 'FuncFormField',
    components: { EditFieldConfig },
    props: { funcBean: Object, bean: Object, drawer: Boolean, formDesign: Boolean },
    setup(props, { expose }) {
      const el = ref();
      // TODO: 暴露doSave方法，用于drawer保存关闭使用，返回Promise，成功关闭
      expose({
        doSave() {
          return el.value?.doSave?.();
        },
      });
      return { el };
    },
  });
</script>
